/*
	klib_ACPI_tables.c

	contains functionality for fetching the ACPI tables

	Author: Aidan Goddard 19/10/13
*/

#include "headers/ktypes.h"
#include "headers/klib_ACPI_tables.h"

ACPI_MADT *__KLIB__ACPIGetMADTBase()
{
	return ACPIGetMADTBase();
}

ACPI_FADT *__KLIB__ACPIGetFADTBase()
{
	return ACPIGetFADTBase();
}

ACPI_DSDT *__KLIB__ACPIGetDSDTBase()
{
	return ACPIGetDSDTBase();
}

ACPI_HPET *__KLIB__ACPIGetHPETBase()
{
	return ACPIGetHPETBase();
}

uint32_t __KLIB__SystemConfigLock()
{
	__asm__ __volatile__("":::"memory");
	__asm__ __volatile__("cli");
	__asm__ __volatile__("":::"memory");
	return SystemTableLock();
}

void __KLIB__SystemConfigUnlock(uint32_t CPU)
{
	SystemTableUnlock(CPU);
	__asm__ __volatile__("":::"memory");
	__asm__ __volatile__("sti");
	__asm__ __volatile__("":::"memory");
	return;
}

TBL_SYSCONFIG *__KLIB__GetSystemConfigBase()
{
	return GetSystemConfigBase();
}

